import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type Result = {
  success: boolean;
  data: Array<any>;
};

type NoticeResult = {
  success: boolean;
  bannerList: Array<any>;
  noticeList: Array<any>;
};

type HomeResult = {
  success: boolean;
  simulatorQuestionSize: number;
  simulatorExamSize: number;
  simulatorErrorAnswerSize: number;
  produceExamSize: number;
  fullName: string;
};

export const getAsyncRoutes = () => {
  return http.request<Result>("get", baseUrlApi("getAsyncRoutes"));
};

export const queryNoticeList = () => {
  return http.request<NoticeResult>("get", baseUrlApi("queryNoticeList"));
};

export const queryHomePage = () => {
  return http.request<HomeResult>("get", baseUrlApi("queryHomePage"));
};
